﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using EXT;

namespace BanHangCshap.Class.gkhtdl63.DAL
{
    public abstract class AllInOneDAL:clsBaseDAL
    {
        /*
         * Nhân viên
         */
        public DataTable Nhanvien_LayDanhsach()
        {
            return base.Select("sp_Nhanvien_LayDanhsach");
        }

        public DataTable DSPhieuKhachhang2(long Id_Khachhang2, DateTime Ngay)
        {
            string xlSPName = "sp_DSPhieuKhachhang2";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Id_Khachhang2", "@Ngay" };
            DateTime x = new DateTime(Ngay.Year, Ngay.Month, Ngay.Day, 23, 59, 59, 999);
            object[] xlSPValu = { Id_Khachhang2, x };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable Khachhang2_Congno(object Tungay, object Denngay)
        {
            string xlSPName = "sp_Khachhang2_Congno";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Tungay", "@Denngay" };
            object[] xlSPValu = { Tungay.ToDateTimeStart(),Denngay.ToDateTimeEnd() };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable NCC2_Congno(object Tungay, object Denngay)
        {
            string xlSPName = "sp_NCC2_Congno";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Tungay", "@Denngay" };
            object[] xlSPValu = { Tungay.ToDateTimeStart(), Denngay.ToDateTimeEnd() };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        //Bên kia có rồi mà thôi thêm ở đây nữa
        public DataTable Phieuxuat2_TinhNocuKhachhangK(object Ngay, long Id_Khachhang2)
        {
            string xlSPName = "sp_Khachang2_TinhnocuK";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Ngay", "@Id_Khachhang2" };
            object[] xlSPValu = { Ngay.ToDateTimeStart(), Id_Khachhang2 };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable Phieuxuat2_TinhNocuKhachhangN(object Ngay, long Id_Khachhang2)
        {
            string xlSPName = "sp_Khachang2_TinhnocuN";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Ngay", "@Id_Khachhang2" };
            object[] xlSPValu = { Ngay.ToDateTimeStart(), Id_Khachhang2 };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }
        //

        public DataTable TonghopThuchi(object Tungay, object Denngay)
        {
            string xlSPName = "sp_TonghopThuchi";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Tungay", "@Denngay" };
            object[] xlSPValu = { Tungay.ToDateTimeStart(), Denngay.ToDateTimeEnd() };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable Khachhang2_Intongtop(object Tungay, object Denngay, long Id_Khachhang2)
        {
            string xlSPName = "sp_Khachhang2_Intongtop";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Tungay", "@Denngay","@Id_Khachhang2" };
            object[] xlSPValu = { Tungay.ToDateTimeStart(), Denngay.ToDateTimeEnd(),Id_Khachhang2 };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable NCC2_Intongtop(object Tungay, object Denngay, long Id_Khachhang2)
        {
            string xlSPName = "sp_NCC2_Intongtop";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Tungay", "@Denngay", "@Id_Khachhang2" };
            object[] xlSPValu = { Tungay.ToDateTimeStart(), Denngay.ToDateTimeEnd(), Id_Khachhang2 };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable TonghopGiaodichKhach(object Tungay, object Denngay, long Id_Khachhang2)
        {
            string xlSPName = "sp_TonghopGiaodichKhach";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Tungay", "@Denngay", "@Id_Khachhang2" };
            object[] xlSPValu = { Tungay.ToDateTimeStart(), Denngay.ToDateTimeEnd(), Id_Khachhang2 };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable Khachhang2_Intongtop2(object Tungay, object Denngay, long Id_Khachhang2)
        {
            string xlSPName = "sp_Khachhang2_Intongtop2";//sp_Phieuxuat2_Taoma
            string[] xlSPPara = { "@Tungay", "@Denngay", "@Id_Khachhang2" };
            object[] xlSPValu = { Tungay.ToDateTimeSS(), Denngay.ToDateTimeEE(), Id_Khachhang2 };
            return base.Select(xlSPName, xlSPPara, xlSPValu);
        }

        public DataTable Load_Noidungthuchi2()
        {
            return base.Select("sp_Load_Noidungthuchi2");
        }
    }
}
